#pragma comment ( lib, "SC_Collision.lib"     )

void SC_Start( );	//called before any other commands
void SC_ErrorMode( int mode ); //set the error mode from this point onwards to: 0=ignore, 1=display, 2=display&quit (default)

void SC_SaveCollisionObject( int obj, char *szFilename );	//save an object's collision data to a file, the object must exist in DarkGDK and the collision system
void SC_SetupObjectFromFile( int obj, int group, char *szFilename );  //load a collision file into an object, the object must exist in DarkGDK

void SC_SetObjectCollisionOn(int obj);	//sets collision on for the specified object (default)
void SC_SetObjectCollisionOff(int obj); //sets collision off for the specified object
DWORD SC_CollisionStatus(int obj);		//returns 1 if collision is on, 0 if off

void SC_SetupObject(int obj, int group, int objecttype);	//adds the specified object to the collision system, type: 0=polygon, 1=sphere, 2=box
void SC_SetupComplexObject(int obj, int group, int facesPerNode);	//adds the specified object to the collision system as a polygon tree, faster than polygon
void SC_SetupTerrainObject(int obj, int group, int tempobj);	//adds an advanced terrain object to the collision system as a polygon tree
void SC_RemoveObject(int obj);	//removes an object from the collision system
void SC_UpdateObject(int obj);	//updates the local position and rotation of the object using its current location

void SC_AllowObjectScaling(int obj);	//takes object scaling into account in collision calculations

DWORD SC_GetObjectCount();	//counts number of objects checked for collision since last call
DWORD SC_GetRayCount();	//counts number of rays checked for collision since last call

void SC_DrawObjectBounds(int obj);	//draws box, sphere and tree bounds around objects setup for these collision object types
void SC_RemoveVisualBounds(int obj); //deletes the visual bounds objects

DWORD SC_ObjectCollision(int obj1, int obj2);	//returns 1 if the two objects are intersecting, use obj2=0 to check all objects, returns id of intersecting object
DWORD SC_GroupCollision(int obj, int group);	//returns the id of any object in 'group' that the obj is intersecting

float SC_IntersectObject(int obj,float oldx,float oldy,float oldz, float x, float y, float z); //legacy, same functionality as DBPro's intersect object, returns distance
DWORD SC_RayCast(int obj,float oldx,float oldy,float oldz, float x, float y, float z,int excludeObj); //returns 1 if the ray intersects the object, use obj=0 for all objects, then returns the id of the obj struck first along the ray
DWORD SC_RayCastGroup(int group,float oldx,float oldy,float oldz, float x, float y, float z,int excludeObj); //returns the id of the first intersecting object along the ray that belongs to the specified group
DWORD SC_MultipleRayCast(int obj,float oldx,float oldy,float oldz, float x, float y, float z,int excludeObj); //stores all collisions along the ray, use obj=0 for all objects
DWORD SC_MultipleRayCastGroup(int group,float oldx,float oldy,float oldz, float x, float y, float z,int excludeObj); //stores all collisions along the ray that belong to the specified group

DWORD SC_SphereCast(int obj,float oldx,float oldy,float oldz, float x,float y,float z,float radius,int excludeObj); //same as ray cast except ray can have a specified size (radius)
DWORD SC_SphereCastGroup(int group,float oldx,float oldy,float oldz, float x,float y,float z,float radius,int excludeObj); //same as ray cast except ray can have a specified size (radius)
DWORD SC_SphereSlide(int obj,float oldx,float oldy,float oldz, float x,float y,float z,float radius,int excludeObj); //does a 3 iteration sphere cast to position the sphere in a non-intersecting position
DWORD SC_SphereSlideGroup(int group,float oldx,float oldy,float oldz, float x,float y,float z,float radius,int excludeObj); //does a 3 iteration sphere cast to position the sphere in a non-intersecting position with the specified group

void SC_SetMaxCollisions( int num );	//sets the maximum number of collisions stored from the multiple ray cast commands

float SC_GetCollisionDistance(int num=0);	//returns the distance of the specified collision from the beginning of the ray
float SC_GetStaticCollisionX(int num=0);	//returns the X position of the collision point
float SC_GetStaticCollisionY(int num=0);	//returns the Y position of the collision point
float SC_GetStaticCollisionZ(int num=0);	//returns the Z position of the collision point
float SC_GetCollisionNormalX(int num=0);	//returns the X component of the collision normal
float SC_GetCollisionNormalY(int num=0);	//returns the Y component of the collision normal
float SC_GetCollisionNormalZ(int num=0);	//returns the Z component of the collision normal
float SC_GetCollisionBounceX(int num=0);	//returns the X component of the collision reflection vector
float SC_GetCollisionBounceY(int num=0);	//returns the Y component of the collision reflection vector
float SC_GetCollisionBounceZ(int num=0);	//returns the Z component of the collision reflection vector
float SC_GetCollisionSlideX(int num=0);		//returns the X position of the non-intersecting sphere position from SphereSlide
float SC_GetCollisionSlideY(int num=0);		//returns the Y position of the non-intersecting sphere position from SphereSlide
float SC_GetCollisionSlideZ(int num=0);		//returns the Z position of the non-intersecting sphere position from SphereSlide
int SC_GetObjectHit(int num=0);				//returns the first object hit along ray, from the last ray cast
int SC_GetGroupHit(int num=0);				//returns the groups id of the first object hit along ray, from the last ray cast
int SC_GetFaceHit(int num=0);				//returns the polygon face hit in first object hit along ray, from the last ray cast, indexed according to memblock order